<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jquery的get请求的ajax</title>
    <script src="js/jquery-3.3.1.js"></script>
    <script>
        function getJqAjax() {

            // alert("执行了")

            //url, data, callback, type
            //url:请求的地址
            //data：请求的数据
                //第一种写法：username=zhangsan&password=laosan
                //第二种写法：{username:"zhangwuji",password:"jiaozhu"}
            //callback：回调函数
            //type:返回的内容格式
            $.post("/servletDemo",{"username":"zhangwuji","password":"jiaozhu"},function (data) {

               // alert("回调还是执行了")
                alert(data);
            },"text");
        }
    </script>
</head>
<body>
    用户名：<input type="text" name="username" value="jack"><br>
    密码：<input type="password" name="password" value="123456"><br>
    <input type="button" value="jq的get请求" onclick="getJqAjax()">
</body>
</html>